package com.ubxtech.core.plugins;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 没有依Mybatis-plus的情况下可以用自己的page对象组装数据,字段直接复制的baomidou的page对象
 * @author Victor.Xiao
 * @since 2022-03-04 16:39
 **/
@Data
public class Page<T> {

    @Schema(title = "总条数")
    private long total;
    @Schema(title = "每页显示数量")
    private long size;
    @Schema(title = "总页码")
    private long pages;
    @Schema(title = "当前页码")
    private long current;
    @Schema(title = "返回的记录")
    private List<T> records;

    public Page(long current, long size) {
        this.size = size;
        this.current = current;
    }

    public Page() {
    }
}
